package com.cn.serverline.lineicp.productionLine.service.impl;

import com.cn.serverline.lineicp.productionLine.entity.WeekStageDay;
import com.cn.serverline.lineicp.productionLine.mapper.WeekStageDayMapper;
import com.cn.serverline.lineicp.productionLine.service.IWeekStageDayService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.util.ObjectUtil;
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;


/**
 * <p>
 * 交付计划周计划日 服务实现类
 * </p>
 *
 * @author 郭明然
 * @since 2024-08-22
 */
@Service("WeekStageDayServiceImpl")
public class WeekStageDayServiceImpl extends ServiceImpl<WeekStageDayMapper, WeekStageDay> implements IWeekStageDayService {
    @Override
    public void add(WeekStageDay weekStageDay) {
        this.save(weekStageDay);
    }

    @Override
    public void del(WeekStageDay weekStageDay) {
        this.removeById(weekStageDay);
    }

    @Override
    public void edit(WeekStageDay weekStageDay) {
        this.updateById(weekStageDay);
    }

    @Override
    public WeekStageDay detail(WeekStageDay weekStageDay) {
        return this.getById(weekStageDay);
    }

    @Override
    public PageResult<WeekStageDay> findPage(WeekStageDay weekStageDay) {
        LambdaQueryWrapper<WeekStageDay> wrapper = new LambdaQueryWrapper<>();
        // 筛选主要属性
        /* wrapper.select(WeekStageDay::getId, WeekStageDay::getPositionName, WeekStageDay::getCode, WeekStageDay::getRemark,
        WeekStageDay::getPositionSort, BaseEntity::getCreateTime);*/

        Page<WeekStageDay> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
        return PageResultFactory.createPageResult(sysRolePage);
    }
}
